/**
 * @description 定义业务路由--动态加载，也叫懒加载
 */

import store from "@/store";

// ES6模块化引入机制
// const Home = () => import(/** webpackChunkName: "Home" */'../views/home')
// const SupplierEdit = () => import(/** webpackChunkName: "SupplierEdit" */'../views/purchase/supplier/edit')


const routes = [
  { path: "/home", name: "首页", component: () => import("../views/home") },
  {
    path: "/userManagement",
    name: "列表示例",
    component: () => import("../views/userManagement"),
  },
  {
    path: "/children/",
    name: "用户列表",
    component: () => import("../views/children/index.vue"), 
    children: [
      {
        path: "one", 
        name: "子集1",
        component: () => import("../views/children/children.vue"),
      },
      {
        path: "two", 
        name: "子集2",
        component: () => import("@/views/children/children1.vue"),
      },
    ]
  },
];
// 动态加载路由
// let menuList = store.getters['common/menuList'].filter(it => !!it.path)
// let routes = menuList.map(it => (
//         {
//             path: it.path,
//             component: (() => import('../views' + it.path))
//         }
//     )
// )

export default routes;
